package com.cross.core;

/**
 * 读出器的抽象类
 * 
 * 2009-5-11
 * 
 * @author craziness_stone
 */
public abstract class AbstractReader implements Reader {
	// 当前行
	protected Row currentRow;
	// 当前行号
	protected long rowIndex = 0;
	// 总行号
	protected long totalIndex = 0;
	// 标题
	protected Header header;

	/**
	 * 
	 * 是否可用
	 * 
	 * Mar 8, 2009
	 * 
	 * @author craziness_stone
	 * @return
	 */
	@Override
	public boolean available() {
		return true;
	}

	/**
	 * 是否还有下一行
	 * 
	 * 
	 * 2009-5-11
	 * 
	 * @author craziness_stone
	 * @return
	 */
	@Override
	public boolean hasNext() {
		return nextRow();
	}

	/**
	 * 移到下一行
	 * 
	 * 2009-5-11
	 * 
	 * @author craziness_stone cc
	 * @return
	 */
	protected abstract boolean nextRow();

	/**
	 * 获得下一行数据
	 * 
	 *
	 * 2009-5-11 
	 * @author craziness_stone
	 * @return
	 */
	public Row next() {
		return currentRow;
	}

	/**
	 * 移出行
	 * 
	 *
	 * 2009-5-11 
	 * @author craziness_stone
	 */
	@Override
	public void remove() {

	}

	/**
	 * 获得表头对象
	 * 
	 *
	 * 2009-5-11 
	 * @author craziness_stone
	 * @return
	 */
	@Override
	public Header getHeader() {
		return header;
	}
}
